<template>
  <div>子组件收到的：{{msg}}</div>
  <div>{{childMessage}}</div>
</template>

<script lang="ts">
  import {inject } from "vue";


  export default {
    props: {
      msg: String,
    },
    setup() {
      //const msg = ref('Hello world');
      const childMessage  = inject("tochildMsg"); //接收父组件传过来的参数
      return {
        //msg,
        childMessage
      }
    }
  }
</script>

<style scoped>

</style>
